package com.googlecode.dgwt.client.dijit.form;

import com.googlecode.dgwt.client.dijit.Dijit;
import com.googlecode.dgwt.client.dijit.form.base.TextBoxBase;
import com.googlecode.dgwt.client.dijit.theme.CSS;

/**
 * @author wellsantos@wellsantos.com
 * @since 0.01
 */
public class PasswordTextBox extends TextBoxBase {
    
    
    public PasswordTextBox() {
        super(true);
    }

    
    protected PasswordTextBox(boolean ready) {
        super(ready);
    }

    
    @Override
    public CSS getThemeCSS() {
        return Dijit.getTheme().dijitTextBox();
    }

    
    @Override
    protected void buildRendering() {
        loadFromTemplate(Dijit.TEMPLATE_RESOURCES.textBox());
    }
    

    @Override
    public String getTemplateParameter(String name) {
        if ("type".equals(name)){
            return "password";
        }
        if ("autocomplete".equals(name)){
            return "off";
        }
        return super.getTemplateParameter(name);
    }

}
